package top.zackyoung.springboot.service.impl

import com.github.yulichang.base.MPJBaseServiceImpl
import org.springframework.stereotype.Service
import top.zackyoung.springboot.entity.KotlinUser
import top.zackyoung.springboot.jpa.KotlinUserDao
import top.zackyoung.springboot.mapper.KotlinUserMapper
import top.zackyoung.springboot.service.KotlinUserService
import java.util.*
import javax.annotation.Resource

@Service
open class KotlinUserServiceImpl : MPJBaseServiceImpl<KotlinUserMapper, KotlinUser>(), KotlinUserService {
    @Resource
    lateinit var kotlinUserDao: KotlinUserDao
    @Resource
    lateinit var kotlinUserMapper:KotlinUserMapper
    override fun getById(id: Long): Optional<KotlinUser> {
        return kotlinUserDao.findById(id)
    }

    override fun getByIdMP(id: Long): Optional<KotlinUser> {
        return Optional.ofNullable(kotlinUserMapper.selectById(id))
    }
}